import Vue from 'vue'
import Vuex from 'vuex'
import axios from 'axios';
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    list:[]
  },
  mutations: {
    setList(state,payload){
     state.list=payload
    }
  },
  actions: {
   async SETLIST({commit}){
      let res=await axios.get('/api/getList');
        commit('setList',res.data.list)
    }
  },
  modules: {

  }
})
